<%@taglib uri="/WEB-INF/struts-bean.tld"  prefix="bean"%>
<script language="JavaScript">
    function validate_form(){
        if ( document.UserForm.userName.value == "" ){
            alert ( "<bean:message key="user.userName"/> "+isEmpty );
        }else if ( document.UserForm.password.value == "" ){
            alert ( "<bean:message key="user.password"/> "+isEmpty );
        }else if ( document.UserForm.nama.value == "" ){
            alert ( "<bean:message key="user.nama"/> "+isEmpty );
        }else if ( document.UserForm.departement.value == "" ){
            alert ( "<bean:message key="user.departement"/> "+isEmpty );
        }else {
            document.UserForm.submit();
        }
    }

    function validate_login_form(){
        if ( document.UserForm.userName.value == "" ){
            alert ( "<bean:message key="user.userName"/> "+isEmpty );
        }else if ( document.UserForm.password.value == "" ){
            alert ( "<bean:message key="user.password"/> "+isEmpty );
        }else if ( document.UserForm.departement.value == "" ){
            alert ( "<bean:message key="user.departement"/> "+isEmpty );
        }else {
            document.UserForm.submit();
        }
    }

    function showForm() {
        var form = "<form action=\"/SistemInformasi/user.do\">";
        form = form + "<input type=\"text\" name=\"search\" size=\"100\"> <input type=\"submit\" value=\"Search\"> <input type=\"hidden\" name=\"action\" value=\"userSearch\">";
        form = form + "</form>";
        document.getElementById("formSearch").innerHTML = form;
    }
</script>